package com.qlhx.controller;

import com.qlhx.common.model.ApiResult;
import com.qlhx.common.model.DataGridResult;
import com.qlhx.model.BaseAccessRecord;
import com.qlhx.mybatis.page.Pagination;
import com.qlhx.service.BaseMiddleService;
import com.sun.net.httpserver.Authenticator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Create by byl
 *
 * @versio 1.0.0
 * @Author baiyanlong
 * @date 2019/7/27 16:14
 * @description desc:
 */
@CrossOrigin(maxAge = 3600)
@Scope(value = "prototype")
@RestController
@RequestMapping("/baseMiddle")
public class BaseMiddleController {

    private final Logger logger = LoggerFactory.getLogger(AccessRecordController.class);

    @Autowired
    private BaseMiddleService baseMiddleService;
    @RequestMapping(value = "list/{groupId}", method = RequestMethod.POST ,produces = { "application/json" })
    public @ResponseBody ApiResult<List> list(@PathVariable  Integer groupId, @RequestHeader String token) {
        ApiResult<List> apiResult = new ApiResult<>();
        List list = baseMiddleService.selectPersonByGroupId(groupId);
        apiResult.setContent(list);
        return apiResult;
    }


}
